@echo off
:: callls the logger s/set/export/gi s/%//gi s/%_/\$/gi s/\.cmd/.sh/gi for *nix ; ) 
:: the name of the Product 
set _ProductName=morphus

:: the version of the current Product 
set _ProductVersion=0.1.0

:: could be dev , test , qa , prod
set _ProductType=dev

:: who owns this Product / environment 
set _ProductOwner=ysg
	
set _EnvironmentName=%_ProductName%.%_ProductVersion%.%_ProductType%.%_ProductOwner%

:: the basedir 
set _BaseDir=E:\Perl\sfw

:: The version directory of the Product 
set _ProductVersionDir=%_BaseDir%\%_ProductName%\%_EnvironmentName%

:: The Perl script performing all the tasks
set _PerlScript=%_ProductVersionDir%\sfw\perl\%_ProductName%.pl

:: the IniFile containing all the configuration 
:: Note the %computername% which must be replaced with the hostName of the 
:: running host 
set _IniFile=%_ProductVersionDir%\conf\%_EnvironmentName%.%ComputerName%.ini

:: where the error logs of this call are situated 
set _ErrorLog=%_ProductVersionDir%\data\log\%_ProductName%.cmd.error.log

:: where the running of this 
set _RunLog=%_ProductVersionDir%\data\log\%_ProductName%.cmd.log

:: define a favorite editor 
set _MyEditor=textpad


ECHO Check the variables 
echo date is %date% time is %time% > %_RunLog%
echo date is %date% time is %time% > %_ErrorLog%
set _ >> %_RunLog%

:: Action !!!
:: with debugging perl -d:ptkdb %_PerlScript% %_IniFile% >> %_RunLog% 2>> %_ErrorLog%
perl %_PerlScript% %_IniFile% >> %_RunLog% 2>> %_ErrorLog%

:: now o
cmd /c start /max %_MyEditor% %_RunLog%
cmd /c start /max %_MyEditor% %_ErrorLog%
:: ping localhost -n 5